Skip to content

Capture update failures by stage and record - #544

Open
JusterZhu wants to merge 1 commit into
justerzhu-upgrade-report-record-typefrom
justerzhu-upgrade-failure-stage-collection
Open

JusterZhu wants to merge 1 commit into
justerzhu-upgrade-report-record-typefrom
justerzhu-upgrade-failure-stage-collection

Conversation

@JusterZhu

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve original local download and package errors with their record identity; classify failures only at known download, verification, extraction, patch and rollback boundaries.
  • Send optional sanitized diagnostic fields via the existing source-generated JSON contract, and avoid generic reports overwriting per-record failures.
  • Preserve the original failure and separately report a failed rollback; document limitations and add data-flow, fallback, legacy DTO, and serialization tests.

Dependencies and limitations

  • Stacked on Fix upgrade report record routing and status sequencing #541 for record routing and report type propagation.
  • Full-package fallback failures are associated with the originating chain record; the IPC contract does not carry a distinct fallback record ID.
  • Cancellation/network timeout, startup, compatibility checks, custom components without stage metadata and self-check are not classified here. No server-side history retention is assumed.
  • Add opt-in durable update report replay #543 durable queue is independent; combined queue restart/replay verification is being performed separately.

Validation

  • CoreTest: 995 passed; focused failure/routing tests: 23 passed.
  • Core build: netstandard2.0, net8.0 and net10.0 passed; existing GeneralTracer IL2026 warnings remain, no new IL warnings observed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Stage diagnostics misclassify custom-pipeline failures and cancellation, while an exception reporting the original failure can suppress the separate rollback-failure report.

3 open issues
What changed in this PR

This PR adds stage-specific failure diagnostics to the update flow, building on #541’s per-record routing. It preserves original exceptions locally while sending sanitized diagnostic fields through the existing JSON reporting contract.

Changes:

  • Track failure stages and record identity across downloads, package processing, fallback, and rollback.
  • Add optional diagnostic fields and suppress generic reports when per-record failures were produced.
  • Document reporting limitations and add failure-flow and serialization compatibility tests.
File Description
tests/​CoreTest/​Strategy/​FailureReportingTests.cs Tests failure routing, fallback, rollback, and JSON compatibility.
src/​GeneralUpdate.Core/​Strategy/​UpdateStrategy.cs Suppresses generic reports after per-record package failures.
src/​GeneralUpdate.Core/​Strategy/​ClientStrategy.cs Emits original download errors and reports failures per record.
src/​GeneralUpdate.Core/​Strategy/​AbstractStrategy.cs Tracks package diagnostics and separate rollback failures.
src/​GeneralUpdate.Core/​Pipeline/​PipelineContext.cs Stores the pipeline failure category.
src/​GeneralUpdate.Core/​Pipeline/​PipelineBuilder.cs Classifies failures at built-in middleware boundaries.
src/​GeneralUpdate.Core/​Event/​ExceptionEventArgs.cs Adds record identity and category to local events.
src/​GeneralUpdate.Core/​Download/​Reporting/​IUpdateReporter.cs Adds optional diagnostics and sanitized report construction.
src/​GeneralUpdate.Core/​Download/​Orchestrators/​DefaultDownloadOrchestrator.cs Preserves verification errors and categorizes semaphore timeouts.
src/​GeneralUpdate.Core/​Download/​Models/​DownloadProgress.cs Adds original exceptions and categories to download results.
src/​GeneralUpdate.Core/​Download/​Executors/​OssDownloadExecutor.cs Preserves original OSS download exceptions.
src/​GeneralUpdate.Core/​Download/​Executors/​HttpDownloadExecutor.cs Preserves original HTTP download exceptions.
docs/​core-execution-flow.md Documents diagnostics, sanitization, and reporting limitations.

Review effort: Balanced

downloadResult.RetryCount, false, $"SHA256 verification failed: {ex.Message}")
{
Error = ex,
FailureCategory = Reporting.FailureCategory.Verify
{
await middleware.InvokeAsync(context);
}
catch
Comment on lines +315 to +317
await Reporter.ReportAsync(record.Value).ConfigureAwait(false);
if (rollbackFailures.Contains(record.Key))
await Reporter.ReportAsync(FailureReports.Create(record.Key, _configinfo.ReportType, FailureCategory.Rollback)).ConfigureAwait(false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants